package com.yunpeng.aidevice.task;

import com.yunpeng.aidevice.cache.service.IRelationValueUpdateQueueService;
import com.yunpeng.common.util.AppConfig;
import com.yunpeng.aidevice.dao.mapper.entity.ICommonMapper;
import com.yunpeng.common.util.AppConfig;

/**
 * InternalServiceManager 内部服务获取
 *
 * @author : Moore(hemw)
 * @date : 2020-04-06
 */
public enum InternalServiceManager {
    /**
     * 单例对象
     */
    INSTANCE;

    /**
     * 关联表更新队列
     */
    private IRelationValueUpdateQueueService relationValueUpdateQueueService;

    /**
     * 关联表更新sql执行mapper
     */
    private ICommonMapper commonMapper;

    public IRelationValueUpdateQueueService getRelationValueUpdateQueueService() {
        if (relationValueUpdateQueueService == null) {
            relationValueUpdateQueueService = AppConfig.getBean(IRelationValueUpdateQueueService.class);
        }
        return relationValueUpdateQueueService;
    }

    public ICommonMapper getCommonMapper() {
        if (commonMapper == null) {
            commonMapper = AppConfig.getBean(ICommonMapper.class);
        }
        return commonMapper;
    }
}
